import java.awt.Graphics;
import java.awt.Image;
import java.awt.Rectangle;


public class Card extends Rectangle {
	Image back = ImageLoader.images.get("cardBack");
	Image front;
	Image currentImage;
	
	public Card (int x, int y, Image front) {
		this.x = x;
		this.y = y;
		this.width = back.getWidth(null);
		this.height = back.getHeight(null);
		this.front = front;
		this.currentImage = back;
	}
	
	public void flip () {
		if (currentImage == back) {
			currentImage = front;
		} else if (currentImage == front) {
			currentImage = back;
		}
	}
	
	public void draw (Graphics g) {
		g.drawImage(currentImage, x, y, null);
	}
}
